<?php
class AdminAction extends CAction {

	public $viewName = 'Admin';
	public $modelName = '';
	
	public $searchColumns = array('id');
	public $dataColumns = array();
	protected $_view;
	
	public function setView($view) {
		$this->_view = $view;
	}
	
	public function run() {
		
		$modelName = $this->modelName;
		
		$model = new $modelName('search');
		$model->unsetAttributes();
		
		if(isset($_GET[$modelName])) {
			$model->attributes = $_GET[$modelName];
		}
		
		$this->controller->createView($this->_view, array(
			'model' => $model,
			'dataProvider' => $model->search(),
			'searchColumns' => $this->searchColumns,
			'dataColumns' => $this->dataColumns,
		))->render();
		
	}
	
	
}